package day52.basic.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class PhoneCheck {
    public static Boolean isMobile(String mobile) {
        String regex = "^((13[0-9])|(14[579])|(15([0-3]|[5-9]))|(16[56])|(17[0-8])|(18[0-9])|(19[1589]))\\d{8}$";
        Pattern p = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
        Matcher m = p.matcher(mobile);
        return m.matches();
    }

    public static void main(String[] args) {
        String phone = "18030450935";
        Boolean mobile = PhoneCheck.isMobile(phone);
        System.out.println(mobile);
    }
}
